package org.kumas.sgrpc.remoting.exchange;

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;

import org.kumas.sgrpc.remoting.Channel;
import org.kumas.sgrpc.remoting.RemotingException;

/**
 *
 * @author KumasZhang
 * @version 1.0
 * @since 2021-07-21 18:13
 */
public interface ExchangeChannel extends Channel {

    CompletableFuture<Object> request(Object request, ExecutorService executor) throws RemotingException;

    CompletableFuture<Object> request(Object request, int timeout, ExecutorService executor) throws RemotingException;

    ExchangeHandler getExchangeHandler();

    @Override
    void close(int timeout);
}
